<f:view xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:sf="http://www.springframework.org/tags/faces"
  contentType="text/html" encoding="UTF-8">

  <h1 class="pageTitle">Your current cart</h1>
  <h:form>
    <h:commandLink action="search" title="back to your search">
        Back to search
      </h:commandLink>
  </h:form>


Votre panier actuel !! il y a #{flowScope.nbProductCurrentOrder} produit(s) dans votre commande.
  <h:form id="listProduct">
    <h:dataTable border="2" cellpadding="2" cellspacing="2" first="0"
      rows="#{flowScope.nbProductCurrentOrder}" width="100%" dir="LTR"
      frame="border" rules="all" rowClasses="row1, row2"
      headerClass="head" columnClasses="column,,,,column"
      value="#{flowScope.currentOrder}" var="product" bgcolor="#F1F1F1"
      id="persons">

      <h:column>
        <f:facet name="header">
          <f:verbatim> Product ID </f:verbatim>
        </f:facet>

        <h:commandLink id="uid" value="#{product.ASIN}" action="detail"
          title="#{product.name}">
          <f:setPropertyActionListener value="#{product}"
            target="#{flowScope.detailProductRow}" />
        </h:commandLink>
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Name</f:verbatim>
        </f:facet>
        <h:outputText value="#{flowScope.currentOrderMap[0]['Title']}" />
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Price</f:verbatim>
        </f:facet>
        <h:outputText
          value="#{flowScope.currentOrderMap[0]['ListPrice.FormattedPrice']}" />
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Categorie</f:verbatim>
        </f:facet>
        <h:outputText value="#{product.categoryId}" />
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Actions</f:verbatim>
        </f:facet>
        <h:commandButton value="Delete" action="deleteProduct"
          type="submit">
          <f:setPropertyActionListener value="#{product}"
            target="#{flowScope.selectedProductRow}" />
        </h:commandButton>
      </h:column>
    </h:dataTable>
  </h:form>

  <br />

  <h:form>
    <h:commandButton value="Buy now" action="buynow" type="submit">
    </h:commandButton>
  </h:form>

  <br />
Total Price : #{price}
        
Vos precedantes commandes : #{flowScope.nbOrderByCustomer} commandes
  <h:form id="listOrder">
    <h:dataTable border="2" cellpadding="2" cellspacing="2" first="0"
      rows="#{flowScope.getNbProduct}" width="100%" dir="LTR"
      frame="border" rules="all" rowClasses="row1, row2"
      headerClass="head" columnClasses="column,,,column"
      value="#{flowScope.orders}" var="ord" bgcolor="#F1F1F1"
      id="orders">

      <h:column>
        <f:facet name="header">
          <f:verbatim>Order ID</f:verbatim>
        </f:facet>

        <h:commandLink id="id" value="#{ord.id}" action="showOldOrder"
          title="#{ord.customer}">
          <f:setPropertyActionListener value="#{ord}"
            target="#{flowScope.selectedOrderRow}" />
        </h:commandLink>
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Customer</f:verbatim>
        </f:facet>
        <h:outputText value="#{ord.customer}" />
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Status</f:verbatim>
        </f:facet>
        <h:outputText value="#{ord.status}" />
      </h:column>

      <h:column>
        <f:facet name="header">
          <f:verbatim>Actions</f:verbatim>
        </f:facet>
        <h:commandButton value="Modify" action="modifyOrder"
          type="submit">
          <f:setPropertyActionListener value="#{ord}"
            target="#{flowScope.selectedOrderRow}" />
        </h:commandButton>

        <h:commandButton value="Delete" action="deleteOrder"
          type="submit">
          <f:setPropertyActionListener value="#{ord}"
            target="#{flowScope.selectedOrderRow}" />
        </h:commandButton>
      </h:column>
    </h:dataTable>
  </h:form>

  <h:form>
    <h:commandLink action="back" title="back to the main page">
        Back to the main page
      </h:commandLink>
  </h:form>
</f:view>